<template>
  <div id="container">
  </div>
</template>

<script>
export default {
	name: 'UE',
	created () {
	  var ue = UE.getEditor('container');
	},
    data () {
      return {
        editor: null,
        aaa: ''
      }
    },
    props: {
      defaultMsg: {
        type: String
      },
      config: {
        type: Object
      }
    },
    watch: {
    	  defaultMsg: function (val) {
    	  this.editor.setContent(val)  // 确保UE加载完成后，放入内容。
    	}
    },
    mounted() {
      const _this = this;
      _this.editor = UE.getEditor('container', _this.config); // 初始化UE
      _this.editor.addListener("ready", function () {
      });
    },
    methods: {
      getUEContent() { // 获取内容方法
        return this.editor.getContent()
      }
    },
    destroyed() {
      this.editor.destroy();
    }
}
</script>

<style scoped>

</style>
